<template>
  <div>
    <p>请选择你喜欢的专栏</p>
    <ul class="li1">
      <li v-for="item in list" :key="item">
        <input type="checkbox" v-model="hobby" :value="item" />{{ item }}
      </li>
    </ul>
    <ul>
      <li v-for="(item, index) in hobby" :key="index">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      hobby: [],
    };
  },
};
</script>

<style>
.li1 li {
  list-style: none;
  display: inline-block;
}
</style>